﻿using PseudoOriginalServer;
using System;
using System.IO;
using System.Net.Http;
using System.Text;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            //

            HttpClient client = new HttpClient();
            var result = client.GetAsync("https://www.jianshu.com/p/2057576bfc5a").Result;
            var html = result.Content.ReadAsStringAsync().Result;

            PseudoOriginal_SynonymSubstitution pseudoOriginalHandler = new PseudoOriginal_SynonymSubstitution("dic.txt");

            var outputHtml = pseudoOriginalHandler.Handle(html);

            using (FileStream fs = new FileStream($"Test{DateTime.Now.Ticks}.html", FileMode.Create))
            {
                var bytes = Encoding.UTF8.GetBytes(outputHtml);
                fs.Write(bytes, 0, bytes.Length);
            }
        }
    }
}
